package com.alisls.shequtao.service.goods.utils;

import com.alisls.shequtao.common.model.result.PageResult;
import com.baomidou.mybatisplus.core.metadata.IPage;

/**
 * 描述
 *
 * @author Ke Wang
 */
public class PageUtil {

    public static PageResult convertToPageResult(IPage page) {
        PageResult pageResult = new PageResult();
        pageResult.setCurrentPage(page.getCurrent());
        pageResult.setPageSize(page.getSize());
        pageResult.setTotalPages(page.getPages());
        pageResult.setTotalCount(page.getTotal());
        return pageResult;
    }

}
